package day01;

/**
 *
 * 一个三位数，每位数的立方之和等于该数本身
 * Created by Shinelon on 2016/9/10.
 */
public class Homework2 {
    public static void main(String[] args) {
        for (int i=100;i<1000;i++){
            int a = i/100;
            int b = i/10%10;
            int c = i%10;
            if (a*a*a+b*b*b+c*c*c==i){
                System.out.println("水仙花数是："+ i +"为"+a+"的立方和"+b+"的立方和"+c+"的立方之和");
            }
        }
    }
}
